package com.heng.locks;


//可重入锁
public class ReEntryLockDemo4 {
    public synchronized void m1() {
        System.out.println(Thread.currentThread().getName()+"\t---come in");
        m2();
        System.out.println(Thread.currentThread().getName()+"\t---end m1");
    }

    public synchronized void m2() {
        System.out.println(Thread.currentThread().getName()+"\t---come in");
        m3();
    }
    public synchronized void m3() {
        System.out.println(Thread.currentThread().getName()+"\t---come in");
    }

    public static void main(String[] args) {
        ReEntryLockDemo4 reEntryLockDemo4 = new ReEntryLockDemo4();
        reEntryLockDemo4.m1();

    }
}
